#pragma once
#include "Map.h"
//#include "Set.h"
//#include "RBTree.h"


template<class iterator, class Ref, class Ptr>
class Reverse_Iterator
{
	typedef Reverse_Iterator<iterator, Ref, Ptr> self;
private:
	iterator _it;
public:
	Reverse_Iterator(iterator it)
		:_it(it)
	{}

	self& operator++()
	{
		--_it;
		return *this;
	}

	self& operator++(int)
	{
		self tmp(_it);
		--_it;
		return tmp;
	}

	Ref operator*()
	{
		return *_it;
	}

	Ptr operator->()
	{
		return &(*_it);
	}

	bool operator!=(const self& rit) const
	{
		return _it != rit._it;
	}
	bool operator==(const self& rit) const
	{
		return _it == rit._it;
	}
};